﻿using System;

namespace TempEmployees.BLL.Validations
{
    public class DateField
    {
        private DateTime m_date;

        public DateTime Date { get { return m_date; } }

        public DateField(string date)
        {
            m_date = DateTime.Parse(date);
        }

        public static bool IsValid(string date)
        {
            try
            {
                DateTime dateTime = DateTime.Parse(date);
                return true;
            }
            catch { return false; }
        }

        public static bool IsValid(object date)
        {
            return IsValid(date as string);
        }
    }
}